package com.yndsoft.jc.ui.xiaoyao;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.TextView;

import com.yndsoft.jc.R;
import com.yndsoft.jc.utils.StringUtils;

import java.util.List;

/**
 * 通用纵向Item选项dialog
 *
 * @author lemon
 * @use new ItemDialog(...).show();
 */
public class XYOpenDialog extends Dialog {
    private Context context;
    private String title;
    private TextView tvItemDialogTitle;
    private ListView lvItemDialog;

    public XYOpenDialog(Context context, String title) {
        super(context, R.style.MyDialog);
        this.context = context;
        this.title = title;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.item_dialog);
        setCanceledOnTouchOutside(true);

        tvItemDialogTitle = (TextView) findViewById(R.id.tvItemDialogTitle);
        lvItemDialog = (ListView) findViewById(R.id.lvItemDialog);
        tvItemDialogTitle.setVisibility(StringUtils.isNotEmpty(title, true) ? View.VISIBLE : View.GONE);
        tvItemDialogTitle.setText("" + StringUtils.getCurrentString());
    }
}